package com.hksj.cm.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hksj.cm.dto.DeviceListDTO;
import com.hksj.cm.vo.DeviceMetadataParseInfoVO;
import com.hksj.cm.vo.DeviceVO;
import com.hksj.cm.vo.DeviceMetadataHistoryVO;
import com.hksj.cm.vo.ParticleValueHistoryVO;
import com.hksj.common.config.annotation.DS_TAOS;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName DeviceListManager
 * @Description TODO
 * @Author @陈章
 * @Date 2024/7/26 14:28
 * @Version 1.0
 */
@Mapper
public interface DeviceListMapper {

    List<DeviceVO> queryDeviceInfo(@Param("page")Page<DeviceVO> page,@Param("dto") DeviceListDTO dto);


    List<DeviceMetadataParseInfoVO> queryDeviceMetadataParseInfo(@Param("list") List<String> list);


    DeviceVO deviceLocation(@Param("deviceId") String deviceId);

    @DS_TAOS
    List<DeviceMetadataHistoryVO> eqParticleValueHistoryList(@Param("tableName") String tableName, @Param("deviceId") String deviceId, @Param("section") int section);

    /**
     * 查询设备推送的洁净度粒子的总数
     * @param deviceId 设备id
     * @param tableName 表名
     * @param section 0:按24小时统计 1:按周统计
     * @return 洁净度总数
     */
    @DS_TAOS
    Integer queryParticleValueHistoryCount(@Param("deviceId") String deviceId, @Param("tableName") String tableName,@Param("section")int section);

    @DS_TAOS
    List<ParticleValueHistoryVO> eqParticleValueDay05History(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param("deviceId") String deviceId, @Param("tableName") String tableName,@Param("section")int section);

    @DS_TAOS
    List<ParticleValueHistoryVO> eqParticleValueDay50History(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param("deviceId") String deviceId, @Param("tableName") String tableName,@Param("section")int section);
}
